<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>Swap Avisynth Filter</title>
   <link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body >
<h2>
<a NAME="Swap"></a>SwapUV
/ UToY / VToY / YToUV
</h2>
<p><code>SwapUV </code>(<var>clip</var>)<br>
  <code>UToY </code>(<var>clip</var>)<br>
  <code>VToY </code>(<var>clip</var>)<br>
  <var>YToUV </var>(<var>clipU, clipV [, clipY]</var>)
<p>These four filters are available starting from <em>v2.5</em>.
<p><code>SwapUV</code> swaps chroma channels (U and V) of a clip. Sometimes
the colors are distorted (faces blue instead of red, etc) when loading
a DivX or MJPEG clip in AviSynth v2.5, due to a bug in DivX (5.00-5.02). You can
use this filter to correct it.
<p><code>UToY</code> copies chroma U plane to Y plane, the resulting image
is now half as big. All color (chroma) information is removed, so the image
is now greyscale.
<p>Likewise <code>VToY</code> copies chroma V plane to Y plane, the resulting
image is now half as big. All color (chroma) information is removed, so
the image is now greyscale.
<p><code>YToUV</code> puts the luma channels of the two clips as U and V channels.
Image is now twice as big, and luma is 50% grey. Use <a href="Merge.htm"><code>MergeLuma</code></a>,
if you want to add luma values.
<br>
  Starting from <em>v2.51</em> there is an optional argument <i>clipY</i> which
puts the luma channel of this clip as the Y channel.
<p>Starting from <em>v2.53</em> they also work in YUY2.
<p>&nbsp;
<pre># Blurs the U chroma channel&nbsp;
video = Colorbars(512, 512).ConvertToYV12
u_chroma = UToY(video).blur(1.5)
YtoUV(u_chroma, video.VToY)
MergeLuma(video)</pre>
<p><kbd>$Date: 2005/10/03 16:49:04 $</kbd></p>
<form><input TYPE="Button" VALUE="Back"
onClick="history.go(-1)"></form>
</body>
</html>
